import os
import platform
from itertools import product



def opj(*args):
    return os.path.join(*args)

# # 当前工作目录
# cwd = os.getcwd()
# 拼接出 Version4 目录的路径
linux_path = '/home/data/cjx/LNMP'
win_path = 'D:\CJX\PyTorch\LNMP'
base_path = win_path if platform.system() == 'Windows' else linux_path


data_type_list = ['CollagenFeatureSummary','RegionFeatureSummary','RoiFeatureSummary']
data_to_solve_list = ['Collagen','Region','Roi','total']
metric_type_list = ['_Means','_Stds']

# 结果保存path
result_path =  opj(base_path,'results')
divide_result_path = opj(result_path,'divide-end')
regression_result_path = opj(result_path,'regression')
clinic_analysis_result_path = opj(result_path,'clinic_analysis')
final_model_select_result_path = opj(result_path,'final_model_select')
subgroup_analysis_result_path = opj(result_path,'subgroup_analysis')
final_model_ensemble_result_path = opj(result_path,'final_model_ensemble')
final_result_path = opj(result_path,'final_result')
shap_result_path = opj(result_path,'shap')
signature_construction_model_visulation_result_path = opj(result_path,'signature_construction_model_visualization')
signature_analysis_result_path = opj(result_path,'signature_analysis')
clinic_benefit_result_path = opj(result_path,'clinic_benefit')


weight_result_path = opj(result_path,'weight')
signature_model_weight_path = opj(weight_result_path,'signature_model')
ensemble_model_weight_path = opj(weight_result_path,'ensemble_model')

target_column = 'ALN status'
exclude_columns = ['Patient_ID',target_column]

# 显著性分析通过
# 127为最终选择
import random
# split_random_state_list = random.sample(range(1, 1001), 100)
split_random_state_list = [127]
model_random_state_list = [42]
# selectK_random_state_list = random.sample(range(1, 1001), 10)
selectK_random_state_list = [417]

feature_select_path = opj(base_path,'data','feature_extract')
lasso_feature_path = opj(feature_select_path,'lasso_feature')
rf_feature_path = opj(feature_select_path,'rf_feature')
fs_feature_path = opj(feature_select_path,'fs_feature')
mrmr_feature_path = opj(feature_select_path,'mrmr_feature')
rfe_feature_path = opj(feature_select_path,'rfe_feature')

feature_path_map = {
    'lasso': lasso_feature_path,
    'rf': rf_feature_path,
    'fs': fs_feature_path,
    'mrmr': mrmr_feature_path,
    'rfe': rfe_feature_path
}

data_set =['BCNB','QL']
need_standard_set = {'Logistic','SVM','MLP','KNN'}

current_data_set = 'BCNB'
signature_score_path = opj(base_path,'data','signature')
signature_score_csv_path = opj(signature_score_path,f'{current_data_set}_signature_score.csv')

merge_data_path = opj(base_path,'data','merge_data',current_data_set)
clinic_data_path = opj(base_path,'data','original_data',current_data_set,'Clinic','clinic_data.csv')
patient_original_data_path = opj(base_path,'data','original_data',current_data_set,'Clinic','patient-clinical-data.csv')
feature_select_method = ['lasso']
# feature_select_method = ['lasso','rf']
# feature_select_method = ['lasso','rf','fs','mrmr','rfe']
# classifier = ['rf', 'gbm', 'nn', 'xgb', 'knn', 'ada',  'cat','logic','svm']
classifier = ['logic']
# classifier = ['logic','svm']
combinations = list(product(feature_select_method, classifier))